getOrThrow

inline fun <T> Array<out T>.getOrThrow(index: Int, message: Array<out T>.(Int) -> String): T(source)
inline fun ByteArray.getOrThrow(index: Int, message: ByteArray.(Int) -> String): Byte(source)
inline fun CharArray.getOrThrow(index: Int, message: CharArray.(Int) -> String): Char(source)
inline fun ShortArray.getOrThrow(index: Int, message: ShortArray.(Int) -> String): Short(source)
inline fun IntArray.getOrThrow(index: Int, message: IntArray.(Int) -> String): Int(source)
inline fun LongArray.getOrThrow(index: Int, message: LongArray.(Int) -> String): Long(source)
inline fun FloatArray.getOrThrow(index: Int, message: FloatArray.(Int) -> String): Float(source)
inline fun DoubleArray.getOrThrow(index: Int, message: DoubleArray.(Int) -> String): Double(source)
inline fun BooleanArray.getOrThrow(index: Int, message: BooleanArray.(Int) -> String): Boolean(source)
inline fun <T> List<T>.getOrThrow(index: Int, message: List<T>.(Int) -> String): T(source)

Returns an element at the given index or throws IndexOutOfBoundsException with the message if the index is out of bounds.


inline fun <K, V> Map<K, V>.getOrThrow(key: K, message: Map<K, V>.(K) -> String = { MISSING_KEY }): V(source)

Returns an element at the given key or throws NoSuchElementException with the message if the key is not present.